#ifndef FRACNEOBSTOPSEGYTHREAD_H
#define FRACNEOBSTOPSEGYTHREAD_H

#include <QThread>
#include "util/define.h"
#include "datatype/database.h"
#include "datatype/franceobs.h"
#include "datatype/psegy.h"
#include "QFile"
#include "QDomElement"
#include "config/common.h"
#include "util/define.h"
#include "util/XmlData.h"

class FracneObsToPsegyThread : public QThread
{
    Q_OBJECT
public:
    union
    {
        unsigned char byteval[4];
        short tbytev[2];
        int  fbytev;
    } threeB2long ;
    union
    {
        unsigned char byteval[4];
        int ibytev;
    }fourB2int;
    FracneObsToPsegyThread();
    FracneObsToPsegyThread(QList<QString> fileList,QString xmlName,QString saveDirName);
    void rawToPSegy(QList<QString> fileList,QString xmlName);
protected:
    void run();
private :
    QList<QString> fileList;
    QString saveDirName;
    QString xmlName;

    LONG getCountNum(QList<QString> fileList);
    LONG getFileLength(QString fileName);
    Common *common;
    QString saveName1,saveName2,saveName3,saveName4;
signals:
    void fileFinish(QString name);
    void allFinish();
    void info(QString info);
};

#endif // FRACNEOBSTOPSEGYTHREAD_H
